//
//  MTLiveApiManager.h
//  MeToo
//
//  Created by 俊松何 on 2018/7/19.
//  Copyright © 2018年 tianxie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MTLiveModel.h"
#import "MTUserModel.h"
#import "MTLiveModel.h"
#import "giftModel.h"
#import "MTLiveTypeModel.h"

@interface MTLiveApiManager : NSObject

+(instancetype)manager;

/**
 关闭直播间

 @param liveId 直播liveId
 @param completionBlock 完成block
 */
-(void)closeLive:(NSString *)liveId
      completion:(void (^)(MTError *error))completionBlock;

/**
 加入直播间

 @param liveId 房间id
 @param completionBlock 完成block
 */
-(void)joinLive:(NSString *)liveId
     completion:(void (^)(MTError *error))completionBlock;

/**
 创建直播

 @param title 直播title
 @param cover cover
 @param topics 话题
 @param completionBlock 完成block
 */
-(void)createLiveWithTitle:(NSString *)title
                     cover:(NSString *)cover
                    topics:(NSString *)topics
                    typeId:(NSInteger)typeId
                completion:(void (^)(MTLiveModel* liveModel,MTError *error))completionBlock;

/**
 退出直播

 @param liveId 直播id
 @param completionBlock 完成block
 */
-(void)quiteLive:(NSString *)liveId
      completion:(void (^)(MTError *error))completionBlock;

/**
保存直播回放
 
 @param liveId 直播id
 @param completionBlock 完成block
 */
-(void)saveLivePlayback:(NSString *)liveId
             completion:(void (^)(MTError *error))completionBlock;

/**
 获取直播间的观众列表

 @param liveId 直播Id
 @param completionBlock 完成block
 */
-(void)getLiveViewersWithLiveId:(NSString *)liveId
                     completion:(void (^)(NSMutableArray<LTUser *> *viewers, MTError *error))completionBlock;

/**
 获取热门直播列表

 @param page page
 @param completionBlock 完成block
 */
-(void)gethotLiveListWithpage:(int)page
                   completion:(void (^)(MTLiveTotalModel *livetotalModel, MTError *error))completionBlock;



/**
 获取直播间礼物列表

 @param completionBlock 完成block
 */
-(void)getGiftsWithComplation:(void (^)(NSMutableArray<giftModel *> *gifts, MTError *error))completionBlock;

/**
 送礼物

 @param anchorId 主播id
 @param giftId 礼物id
 @param liveId 直播间id
 @param password 用户钱包密码
 @param token  后面token指令
 @param completionBlock 完成block
 */
-(void)sendGiftWithAnchorId:(NSString *)anchorId
                     giftId:(NSString *)giftId
                     liveId:(NSString *)liveId
                   password:(NSString *)password
                      token:(NSString *)token
                 completion:(void (^)(NSString *token, MTError *error))completionBlock;



/**
 通过直播ID获取直播详情

 @param liveId 直播id
 @param completionBlock 完成block
 */
-(void)getLiveInfoWithLiveId:(NSString *)liveId
                  completion:(void (^)(MTLiveModel *liveModel, MTError *error))completionBlock;



/**
 发送弹幕

 @param completionBlock 完成block
 */
-(void)sendBarrageWithcompletion:(void (^)(MTError *error))completionBlock;


-(void)downloadGift;


/**
 获取回放列表

 @param page 页数
 @param userId userid
 @param completionBlock block
 */
-(void)getReplayListWithpage:(int)page
                      userId:(NSString *)userId
                  completion:(void (^)(MTLiveTotalModel *livetotalModel, MTError *error))completionBlock;


/**
 删除回放

 @param liveId 直播id
 @param completionBlock block
 */
-(void)deleteReplayWithLiveId:(NSString *)liveId
                   completion:(void (^)(MTError *error))completionBlock;



/**
 获取types

 @param completionBlock block
 */
-(void)getliveTypesWithcompletion:(void (^)(NSMutableArray<MTLiveTypeModel *> *types,MTError *error))completionBlock;


/**
 获取showtypes
 
 @param completionBlock block
 */
-(void)getshowliveTypesWithcompletion:(void (^)(NSMutableArray<MTLiveTypeModel *> *types,MTError *error))completionBlock;

/**
 获取type直播列表
 
 @param page page
 @param completionBlock 完成block
 */
-(void)gettypeLiveListWithpage:(int)page
                        typeId:(NSInteger)typeId
                    completion:(void (^)(MTLiveTotalModel *livetotalModel, MTError *error))completionBlock;

/**
 管理员或者主播禁言用户
 
 @param masterUserId 主播 masterUserId
 @param targetUserId targetUserId
 @param completionBlock 完成block
 */
-(void)muteUsermasterUserId:(NSString *)masterUserId
               targetUserId:(NSString *)targetUserId
                 completion:(void (^)(MTError *error))completionBlock;

/**
 主播踢出用户
 
 @param liveId 直播Id
 @param targetUserId targetUserId
 @param completionBlock 完成block
 */
-(void)kickOutUserLiveId:(NSString *)liveId
            targetUserId:(NSString *)targetUserId
              completion:(void (^)(MTError *error))completionBlock;

/**
 修改直播title
 
 @param liveId 直播Id
 @param title title
 @param completionBlock 完成block
 */
-(void)modifyLiveTitleLiveId:(NSString *)liveId
                       title:(NSString *)title
                  completion:(void (^)(MTError *error))completionBlock;


/**
 获取直播结束时候的信息
 
 @param liveId 直播ID
 @param completionBlock 完成block
 */
-(void)liveEndInfo:(NSString *)liveId
        completion:(void (^)(MTLiveModel *mdoel,MTError *error))completionBlock;

@end
